package projecto.pkgfinal;

import java.io.Serializable;
import java.util.ArrayList;

public class PessoaSistema extends Pessoa implements Serializable {
    private String username;
    private String password;

    public PessoaSistema(String username, String password, String nomeProprio, int id, int perfil, String apelido, char genero, ArrayList<Telefone> telefones, ArrayList<Morada> moradas,  String bi, String nif, String nss) {
        super(nomeProprio, id, perfil, apelido, genero, telefones, moradas, bi, nif, nss);
        this.username = username;
        this.password = password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public String getUsername() {
        return username;
    }

    @Override
    public String toString() {
                
        StringBuilder b = new StringBuilder();
        b.append(super.toString());
        b.append("=== Acessos ===\n");
        if(getUsername() != null)
            b.append("Username:"+getUsername()+"\n");
        if(getPassword() != null)
            b.append("Password:"+getPassword()+"\n\n");

        return b.toString();
        
    }
    
}
